package br.urca.model;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 * @author Lucas
 */
@Entity
@Table(name = "BI_SERIES")
public class BiSeries implements Serializable {
	
    private static final long serialVersionUID = 1L;
    
    @Id
    @Basic(optional = false)
    @Column(name = "COD_SERIE")
    private Short codSerie;
    
    @Basic(optional = false)
    @Column(name = "NOME")
    private String nome;

    public BiSeries() {
    }

    public BiSeries(Short codSerie) {
        this.codSerie = codSerie;
    }

    public BiSeries(Short codSerie, String nome) {
        this.codSerie = codSerie;
        this.nome = nome;
    }

    public Short getCodSerie() {
        return codSerie;
    }

    public void setCodSerie(Short codSerie) {
        this.codSerie = codSerie;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    @Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((codSerie == null) ? 0 : codSerie.hashCode());
		result = prime * result + ((nome == null) ? 0 : nome.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BiSeries other = (BiSeries) obj;
		if (codSerie == null) {
			if (other.codSerie != null)
				return false;
		} else if (!codSerie.equals(other.codSerie))
			return false;
		if (nome == null) {
			if (other.nome != null)
				return false;
		} else if (!nome.equals(other.nome))
			return false;
		return true;
	}

	@Override
    public String toString() {
        return "model.BiSeries[ codSerie=" + codSerie + " ]";
    }
    
}
